import { Component, OnInit } from '@angular/core';
import {Observable} from "rxjs/Observable";
import {Http} from "@angular/http";
import 'rxjs/Rx';

@Component({
  selector: 'app-product1',
  templateUrl: './product1.component.html',
  styleUrls: ['./product1.component.css']
})
export class Product1Component implements OnInit {

  products:Observable<any>;

  constructor(private http:Http) {
    this.products = this.http.get('/api/products').map((res) => res.json());
  }

  ngOnInit() {
  }

}
